package com.studyyoun.android.nonghe.home.activity;

import android.content.Context;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

/**
 * Created by androidlongs on 16/7/26.
 */
public abstract class CommonBaseActivity extends BaseActivity {
    protected  Context mAppContext ;
    protected  Context mActivityContext;
    public  int  mScreenWidth;
    public int mScreenHeight;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去掉信息栏

        setContentView(getViewLayoutId());
        mAppContext = CommonBaseActivity.this.getApplicationContext();
        mActivityContext = CommonBaseActivity.this;
        getAllExtarDatas();
        initAllView();
        setAllViewClick();
        requestData();
        setCommonFunction();
        mScreenWidth = CommonBaseActivity.this.getWindowManager().getDefaultDisplay().getWidth();
        mScreenHeight = CommonBaseActivity.this.getWindowManager().getDefaultDisplay().getHeight();
    }

    public abstract int getViewLayoutId();

    public abstract void getAllExtarDatas();

    public abstract void initAllView();

    public abstract void setAllViewClick();

    public abstract void displayRequestNetData();

    public abstract void setCommonFunction();

    private void requestData() {

    }
}

